<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>乐码在线智慧平台-教师考评</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="../../static/favicon.ico">
    <link href="../../static/css/bootstrap.min.css?v=3.3.6" th:href="@{/static/css/bootstrap.min.css(v='3.3.6')}"
          rel="stylesheet">
    <link href="../../static/css/font-awesome.css?v=4.4.0" th:href="@{/static/css/font-awesome.css(v='4.4.0')}"
          rel="stylesheet">
    <link href="../../static/css/plugins/bootstrap-table/bootstrap-table.min.css"
          th:href="@{/static/css/plugins/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet">
    <link href="../../static/css/animate.css" th:href="@{/static/css/animate.css}" rel="stylesheet">
    <link href="../../static/css/style.css?v=4.1.0" th:href="@{/static/css/style.css(v='4.1.0')}" rel="stylesheet">
    <!-- bootstrap-datepicker -->
    <link href="../../static/css/plugins/datapicker/datepicker3.css"
          th:href="@{/static/css/plugins/datapicker/datepicker3.css}" rel="stylesheet">
    <!-- Sweet Alert -->
    <link href="../../static/css/plugins/sweetalert/sweetalert.css"
          th:href="@{/static/css/plugins/sweetalert/sweetalert.css}" rel="stylesheet">
    <!--switchery-->
    <link href="../../static/css/plugins/switchery/switchery.css"
          th:href="@{/static/css/plugins/switchery/switchery.css} " rel="stylesheet">

    <style type="text/css">
        .table > thead > tr > th {
            color: #2a62bc;
        }

    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight animated fadeInRight">
    <div class="pull-left col-md-12">
        <form class="form-inline" style="margin:15px -10px">
            <div class="form-group col-md-2">
                <label>班级名称:</label>
                <input type="text" class="form-control" id="clazz_name">
            </div>

            <div class="form-group col-md-2">
                <label>老师名称:</label>
                <input type="text" class="form-control" id="teacher_name">
            </div>
            <div class="form-group col-md-2">
                <label>&nbsp;&nbsp;所属机构:</label>
                <div class="input-group">
                    <input type="text" class="form-control org" id="org-search">
                    <div class="input-group-btn">
                        <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                        </ul>
                    </div>
                    <!-- /btn-group -->
                </div>
            </div>
            <div class="form-group col-md-2">
                <label>&nbsp;&nbsp; 所属分支:</label>
                <div class="input-group">
                    <input type="text" class="form-control branch" id="branch-search">
                    <div class="input-group-btn">
                        <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                        </ul>
                    </div>
                    <!-- /btn-group -->
                </div>
            </div>
            <div class="form-group col-md-2">
                <label>&nbsp;&nbsp; 专业方向:</label>
                <div class="input-group">
                    <input type="text" class="form-control major" id="profession-search">
                    <input type="hidden" id="profession-search-id">
                    <div class="input-group-btn">
                        <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                        </ul>
                    </div>
                    <!-- /btn-group -->
                </div>
            </div>
            <input type="button" class="btn btn-primary" value="查询" id="queryBtn"
                   style="margin-top: 23px;margin-left: -15px"/>

        </form>
    </div>


    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-md-10 table">
            <div class="col-md-2" style="margin: 20px  -15px">
                <div class="btn-group" role="group">
                    <a type="button" class="btn btn-info" data-toggle="modal" data-target="#exportModal">导出</a>
                </div>
                <div class="btn-group" role="group" aria-label="...">
                    <a type="button" class="btn btn-success" id="add-btn" data-toggle="modal"
                       data-target="#addModal">添加</a>
                </div>
                <div class="btn-group" role="group" aria-label="...">
                    <a type="button" class="btn btn-danger" id="remove">删除</a>
                </div>
            </div>
            <!--  bootstrap table  -->
            <table id="tb_major" class="table table-striped table-hover table-bordered"></table>
        </div>
    </div>
</div>


<!-- =======================================导出模态框================================================  -->
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <p>确定要导出吗？</p>
        </div>
    </div>
</div>

<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" id="exportModal">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">提示</h4>
            </div>
            <div class="modal-body">
                <h3>确定要导出吗？</h3>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary">确定</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!--=============================================添加 modal==============================================-->
<div class="modal fade" id="addModal" tabindex="-1">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <span class="close" data-dismiss="modal">&times;</span>
                <h3 class="modal-title">添加</h3>
            </div>

            <div class="modal-body" style="min-height: 400px;margin-top: 20px">
                <form action="#" class="form-horizontal" method="post">
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">所属机构：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control org_add" id="org_add">
                                <div class="input-group-btn" style="z-index:99999 !important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">所属分支：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control branch_add" id="branch_add">
                                <div class="input-group-btn" style="z-index:99999!important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">所属专业：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control profession_add" id="profession_add">
                                <div class="input-group-btn" style="z-index:99999 !important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">所属班级：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control org_update" id="org_class">
                                <div class="input-group-btn" style="z-index:99999 !important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">老师名称：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control org_update" id="add_teacherName">
                                <div class="input-group-btn" style="z-index:99999 !important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label right">允许IP：</label>
                        <div class="col-sm-7">
                            <input class="form-control changeID" type="text" placeholder="例如：192.168.1" id="add_Ip" disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label date">开始时间：</label>
                        <div class="col-sm-7  ">
                            <input type="text" id="startDate" class="form-control mydate" value="2020-6-2" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label date">结束时间：</label>
                        <div class="col-sm-7  ">
                            <input type="text" id="endDate" class="form-control mydate"  value="2020-6-2"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">考评模板：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control org_update" id="add_teacherPollTemplate" name="pollTemplate">
                                <div class="input-group-btn" style="z-index:99999 !important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="radio col-md-offset-1">
                        <label>
                            <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1">
                            <p style="color: red;margin-top: -7px">限定IP网段，一个IP地址只能提交 一次</p>
                        </label>
                    </div>
                    <div class="radio col-md-offset-1">
                        <label>
                            <input type="radio" name="optionsRadios" id="optionsRadios2"  value="option2" checked>
                            <p style="color: red;margin-top: -7px">不限定IP网段，任何IP都可以提交</p>
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" data-dismiss="modal">关闭</button>
                <button class="btn btn-primary" id="add_sure">确定</button>
            </div>
        </div>
    </div>
</div>

<!--=============================================updateModal modal==================================================-->
<div class="modal fade" id="updateModal" tabindex="-1">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <span class="close" data-dismiss="modal">&times;</span>
                <h3 class="modal-title">修改</h3>
            </div>

            <div class="modal-body" style="min-height: 400px;margin-top: 20px">
                <form action="#" class="form-horizontal" method="post">
                    <input type="hidden" class="form-control" id="class_id">
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">所属机构：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control org_update" id="org_update">
                                <div class="input-group-btn" style="z-index:99999 !important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">所属分支：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control branch_update" id="branch_update">
                                <div class="input-group-btn" style="z-index:99999!important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">所属专业：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control profession_update" id="profession_update">
                                <div class="input-group-btn" style="z-index:99999 !important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">所属班级：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control org_update" id="class_update">
                                <div class="input-group-btn" style="z-index:99999 !important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">老师名称：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control org_update" id="update_teacherName">
                                <div class="input-group-btn" style="z-index:99999 !important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label right">允许IP：</label>
                        <div class="col-sm-7">
                            <input class="form-control changeID" type="text" placeholder="例如：192.168.1"
                                   disabled></input>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label ">开始时间：</label>
                        <div class="col-sm-7  ">
                            <input type="text" id="update_startDate" class="form-control mydate" value="2020-6-2"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label ">结束时间：</label>
                        <div class="col-sm-7  ">
                            <input type="text" id="update_endDate" class="form-control mydate" value="2020-6-2"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label right">考评模板：</label>
                        <div class="col-sm-7">
                            <div class="input-group">
                                <input type="text" class="form-control org_update" id="teacher_pollTemplate">
                                <div class="input-group-btn" style="z-index:99999 !important;">
                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="radio col-md-offset-1">
                        <label>
                            <input type="radio" name="optionsRadios" id="optionsRadios3" value="option1">
                            <p style="color: red; margin-top: -7px">限定IP网段，一个IP地址只能提交 一次</p>
                        </label>
                    </div>
                    <div class="radio col-md-offset-1">
                        <label>
                            <input type="radio" name="optionsRadios" id="optionsRadios4" value="option2" checked>
                            <p style="color: red;margin-top: -7px">不限定IP网段，任何IP都可以提交</p>
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" data-dismiss="modal">关闭</button>
                <button class="btn btn-primary" id="update_sure">确定</button>
            </div>
        </div>
    </div>
</div>

<!--  ==================================审核模态框=======================================  -->
<div class="modal fade" id="checkModal" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">详情</h4>
            </div>
            <div class="modal-body">
                <!--     这是体部         -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a href="#pollinfo" aria-controls="info" role="tab"
                                                              data-toggle="tab">考评信息</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 选项得分</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">学生建议</a></li>
                </ul>

                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="pollinfo">
                        <form class="form-horizontal" role="form" id="pollinfo-form" style="padding: 10px" action="#"
                              method="post">
                            <div class="form-group">
                                <label class="col-sm-3">教师名称：</label>
                                <div class="col-md-offset-3">
                                    <span id="check_teacherName"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-7 ">班级名称：</label>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-7 ">考评人数：</label>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-7 ">总平均分：</label>
                            </div>
                        </form>
                    </div><!--end of tab1-->
                    <div id="tab-1" class="tab-pane">
                        <div class="panel-body">
                            <table id="score-option" class="table table-bordered table-striped table-striped option">

                            </table>
                        </div>
                    </div><!--end of tab2-->
                    <div id="tab-2" class="tab-pane">
                        <div class="panel-body">
                            <table class="table table-striped table-bordered table-bordered suggest" id="suggest-table">

                            </table>
                        </div>
                    </div><!--end of tab3-->
                </div>

            </div><!--体部结束-->
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" data-dismiss="modal"><i
                        class="glyphicon glyphicon-remove"></i>&nbsp;关闭
                </button>
                <button type="button" class="btn btn-primary"><i class="glyphicon glyphicon-ok"></i>&nbsp;已审核不可重复提交
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- =========================================详情Modal===================================================================================== -->
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">详情</h4>
            </div>
            <div class="modal-body">
                <!--     这是体部         -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a href="#d-pollinfo" aria-controls="info" role="tab"
                                                              data-toggle="tab">考评信息</a></li>
                    <li class=""><a data-toggle="tab" href="#d-tab-1" aria-expanded="true"> 选项得分</a></li>
                    <li class=""><a data-toggle="tab" href="#d-tab-2" aria-expanded="false">学生建议</a></li>
                </ul>

                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="d-pollinfo">
                        <form class="form-horizontal" role="form" id="d-pollinfo-form" style="padding: 10px" action="#"
                              method="post">
                            <div class="form-group">
                                <label class="col-md-3 ">教师名称：</label>
                                <div class="col-sm-5">
                                    <span id="d-teacher_name" style="text-align:left"></span>
                                    <!--                                    <input type="hidden" id="d-teacher_name" name="teacher_name" class="form-control" >-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 ">班级名称：</label>
                                <div class="col-sm-9">
                                    <span id="d-clazz_name" name="clazz_name"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 ">考评人数：</label>
                                <div class="col-sm-9">
                                    <span id="d-poll_name"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-7 ">总平均分：7</label>
                                <!--<div class="col-sm-9">
                                    <input type="text" id="d-score" name="score" class="form-control" >
                                </div>-->
                            </div>
                        </form>
                    </div><!--end of tab1-->
                    <div id="d-tab-1" class="tab-pane">
                        <div class="panel-body">
                            <table id="d-score-option" class="table table-bordered table-striped table-striped option">
                            </table>
                        </div>
                    </div><!--end of tab2-->
                    <div id="d-tab-2" class="tab-pane">
                        <div class="panel-body">
                            <table class="table table-striped table-bordered table-bordered suggest"
                                   id="d-suggest-table">
                            </table>
                        </div>
                    </div><!--end of tab3-->
                </div>
            </div><!--体部结束-->
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 全局js -->
<script src="../../static/js/jquery.min.js?v=2.1.4" th:src="@{/static/js/jquery.min.js('v=2.1.4')}"></script>
<script src="../../static/js/bootstrap.min.js?v=3.3.6" th:src="@{/static/js/bootstrap.min.js('v=3.3.6')}"></script>

<!-- 自定义js -->
<script src="../../static/js/content.js?v=1.0.0" th:src="@{/static/js/content.js('v=1.0.0')}"></script>

<!-- Bootstrap table -->
<script src="../../static/js/plugins/bootstrap-table/bootstrap-table.min.js"
        th:src="@{/static/js/plugins/bootstrap-table/bootstrap-table.min.js}"></script>
<script src="../../static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"
        th:src="@{/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js}"></script>
<script src="../../static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"
        th:src="@{/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
<!--动态搜索-->
<script src="../../static/js/plugins/suggest/bootstrap-suggest.min.js"
        th:src="@{/static/js/plugins/suggest/bootstrap-suggest.min.js}"></script>
<!-- Sweet alert -->
<script src="../../static/js/plugins/sweetalert/sweetalert.min.js"
        th:src="@{/static/js/plugins/sweetalert/sweetalert.min.js}"></script>
<!-- Switchery -->
<script src="../../static/js/plugins/switchery/switchery.js"
        th:src="@{/static/js/plugins/switchery/switchery.js}"></script>
<!-- Data picker -->
<script src="../../static/js/plugins/datapicker/bootstrap-datepicker.js"
        th:src="@{/static/js/plugins/datapicker/bootstrap-datepicker.js}"></script>
<script src="../../static/js/plugins/datapicker/bootstrap-datepicker.zh-CN.min.js"
        th:src="@{/static/js/plugins/datapicker/bootstrap-datepicker.zh-CN.min.js}"></script>
<!--自定义js---表格操作-->
<!-- 主要用于表格的删除按钮功能实现 -->
<script src="../../static/public/exam/tableOperation.js"
        th:src="@{/static/public/exam/tableOperation.js}">
</script>

<script>
    $(function () {
        /*时间控件配置*/
        $(".mydate").datepicker({
            language: "zh-CN",
            clearBtn: true,//清除
            autoclose: true,
            todayHighlight: true,
            format: 'yyyy-mm-dd',
            todayBtn: false,//今日按钮
            startDate: '1970-1-1', //与你自己设置的格式一致yyyy-mm-dd，未设置的话与默认格式一致mm/dd/yyyy
            endDate: '2070-1-1'
        });
    });
</script>

<script>

    $(function () {
        //初始化表格
        //var init = new initdata();
        //init.Init();
        //点击按钮开始搜索
        $("#queryBtn").click(function () {
            let className = $("#clazz_name").val();
            let teacherName = $("#teacher_name").val();
            let org = $("#org-search").val();
            let branch = $("#branch-search").val();
            let profession = $("#profession-search").val();
            let professionId = $("#profession-search-id").val();
            //判断条件是否存在
            if (className == "" && teacherName == "" && org == "" && branch == "" && profession == "") {
                alert("请选择查询条件");
                return;
            }
            let url = "/owep/evaluation/findClassByKeyword?className=' + className + '&teacherName=' + teacherName + '&instituteName=' + org + '&instituteBranchName=' + branch + '&professionId=' + professionId";
            $("#tb_major").bootstrapTable('refresh', {url: url});
        });

        //查找班级三表关联选项
        var testdataBsSuggest1 = $("#org-search").bsSuggest({
            url: "/owep/evaluation/getAllInstitute",
            idField: "instituteId",
            keyField: "instituteName",
            effectiveFields: ["instituteName"],
        }).on('onSetSelectValue', function (e, keyword) {
            $("#branch-search").bsSuggest("destroy");
            $("#branch-search").bsSuggest({
                url: "/owep/evaluation/getBranchByInstitute?id=" + keyword.id,
                idField: "branchId",
                keyField: "branchName",
                effectiveFields: ["branchName"],
            }).on('onSetSelectValue', function () {
                $("#profession-search").bsSuggest("destroy");
                $("#profession-search").bsSuggest({
                    url: "/owep/evaluation/getProfession?instituteName=" + $("#org-search").val() + "&instituteBranchName=" + $("#branch-search").val(),
                    idField: "id",
                    keyField: "profName",
                    effectiveFields: ["profName"],
                }).on('onSetSelectValue', function (e, keyword) {
                    $("#profession-search-id").val(keyword.id);
                })
            })
        });

        //教师考评中的修改选项
        var testdataBsSuggest2 = $("#class_id").bsSuggest({
            url: "/owep/evaluation/getAllInstitute",
            idField: "instituteId",
            keyField: "instituteName",
            effectiveFields: ["instituteName"],
        }).on('onSetSelectValue', function (e, keyword) {
            $("#branch_update").bsSuggest("destroy");
            $("#branch_update").bsSuggest({
                url: "/owep/evaluation/getBranchByInstitute?id=" + keyword.id,
                idField: "branchId",
                keyField: "branchName",
                effectiveFields: ["branchName"],
            }).on('onSetSelectValue', function () {
                $("#profession_update").bsSuggest("destroy");
                $("#profession_update").bsSuggest({
                    url: "/owep/evaluation/getProfession?instituteName=" + $("#class_id").val() + "&instituteBranchName=" + $("#branch_update").val(),
                    idField: "id",
                    keyField: "profName",
                    effectiveFields: ["profName"],
                }).on('onSetSelectValue', function (e, keyword) {
                    $("#class_update").bsSuggest("destroy");
                    $("#class_update").bsSuggest({
                        url: "/owep/evaluation/getClass?pid=" + keyword.id,
                        idField: "id",
                        keyField: "className",
                        effectiveFields: ["className"],
                    }).on('onSetSelectValue',function(){
                        $("#update_teacherName").bsSuggest("destroy");
                        $("#update_teacherName").bsSuggest({
                            url: "/owep/evaluation/getTeacherName?className=" + $("#class_update").val(),
                            idField: "id",
                            keyField: "teacherName",
                            effectiveFields: ["teacherName"],
                        })
                    })
                })
            })
        });

        //教师考评中的添加
        var testdataBsSuggest3 = $("#org_add").bsSuggest({
            url: "/owep/evaluation/getAllInstitute",
            idField: "instituteId",
            keyField: "instituteName",
            effectiveFields: ["instituteName"],
        }).on('onSetSelectValue', function (e, keyword) {
            $("#branch_add").bsSuggest("destroy");
            $("#branch_add").bsSuggest({
                url: "/owep/evaluation/getBranchByInstitute?id=" + keyword.id,
                idField: "branchId",
                keyField: "branchName",
                effectiveFields: ["branchName"],
            }).on('onSetSelectValue', function () {
                $("#profession_add").bsSuggest("destroy");
                $("#profession_add").bsSuggest({
                    url: "/owep/evaluation/getProfession?instituteName=" + $("#org_add").val() + "&instituteBranchName=" + $("#branch_add").val(),
                    idField: "id",
                    keyField: "profName",
                    effectiveFields: ["profName"],
                }).on('onSetSelectValue', function (e, keyword) {
                    $("#org_class").bsSuggest("destroy");
                    $("#org_class").bsSuggest({
                        url: "/owep/evaluation/getClass?pid=" + keyword.id,
                        idField: "id",
                        keyField: "className",
                        effectiveFields: ["className"],
                    }).on('onSetSelectValue',function(){
                        $("#add_teacherName").bsSuggest("destroy");
                        $("#add_teacherName").bsSuggest({
                            url: "/owep/evaluation/getTeacherName?className=" + $("#org_class").val(),
                            idField: "id",
                            keyField: "teacherName",
                            effectiveFields: ["teacherName"],
                        })
                    })
                   })
                })
            });


        //修改模态框中的考评模板
        var testdataBsSuggest4=$("#teacher_pollTemplate").bsSuggest({
            url:"/owep/evaluation/getAllPollTemplate",
            idField: "id",
            keyField: "templateName",
            effectiveFields: ["templateName"],
        });
        //增加模态框中的考评模板
        //var keywords="[[${keywords}]]";
        var testdataBsSuggest5=$("#add_teacherPollTemplate").bsSuggest({

            url:"/owep/evaluation/getAllPollTemplate",
            idField: "id",
            keyField: "templateName",
            effectiveFields: ["templateName"],
            searchFields:["templateName"]
        });


        //动态搜索选择下拉框
            testdataBsSuggest1;
            testdataBsSuggest2;
            testdataBsSuggest3;
            testdataBsSuggest4;
            testdataBsSuggest5;
            //删除所有
            $('#remove').click(function () {
                // 删除按钮事件
                if (!confirm("是否确认删除？"))
                    return;
                var rows = $("#tb_major").bootstrapTable('getSelections');// 获得要删除的数据
                if (rows.length == 0) {// rows 主要是为了判断是否选中，下面的else内容才是主要
                    alert("请先选择要删除的记录!");
                    return;
                } else {
                    var ids = new Array();// 声明一个数组 该数组将要存放所有选择的id
                    $(rows).each(function () {// 通过获得别选中的来进行遍历
                        ids.push(this.id);// cid为获得到的整条数据中的一列
                    });
                    $.ajax({
                        url: "/owep/evaluation/deleteTeacherPoll",
                        method: "post",
                        async: true,
                        data: JSON.stringify(ids),
                        dataType: "text",   //期望服务端返回的数据类型
                        contentType: "application/json",
                        success: function (data) {
                            console.log(data.toString());
                            swal("删除成功！", "您已经永久删除已选信息", "success");
                            //重新加载页面
                            $("#tb_major").bootstrapTable("refresh")
                        },
                        error: function (jqXHR) {
                            swal("删除失败！", "未知错误", "error");
                        }
                    });
                }
            });

            //添加事件
            $('#add_sure').click(function () {
                let org = $("#org_add").val();
                let branch = $('#branch_add').val();
                let profession = $('#profession_add').val();
                let orgClass = $('#org_class').val();
                let addTeacherName = $('#add_teacherName').val();
                let addIp = $('#add_Ip').val();
                let startDate = $('#startDate').val();
                let endDate = $('#endDate').val();
                let addTeacherPollTemplate = $('#add_teacherPollTemplate').val();
                let optionsRadios1 = $('#optionsRadios1').val();
                let optionsRadios2 = $('#optionsRadios2').val();
                let teacherPoll = {
                    "org": org,
                    "branch": branch,
                    "profession": profession,
                    "orgClass": orgClass,
                    "addTeacherName": addTeacherName,
                    "startDate": startDate,
                    "addIp": addIp,
                    "endDate": endDate,
                    "addTeacherPollTemplate": addTeacherPollTemplate,
                    "optionsRadios1": optionsRadios1,
                    "optionsRadios2": optionsRadios2,
                };
                let teacherPollJSON = JSON.stringify(teacherPoll);
                $.ajax({
                    type: "POST",
                    url: "/owep/evaluation/addTeacherPoll",
                    data: teacherPollJSON,
                    contentType: "application/json",
                    dataType: "text",
                    success: function (data) {
                        alert(data);
                        window.location.reload();
                    },
                    error: function (jqXHQ) {
                        alert("添加失败");
                    }
                });
            });
            //更新时间
            $('#update_sure').click(function () {
                alert("更新成功");
            });

            //});
            // var testdataBsSuggest1 = $(".org").bsSuggest({
            //     indexId: 2, //data.value 的第几个数据，作为input输入框的内容
            //     indexKey: 1, //data.value 的第几个数据，作为input输入框的内容
            //     //TODO 通过json显示数据
            //     data: {
            //         'value': [
            //             {
            //                 'id': "",
            //                 'word': '黑马程序员',
            //             },
            //             {
            //                 'id': "",
            //                 'word': '青英',
            //             },
            //         ]
            //     }
            // });
            // var testdataBsSuggest2 = $(".branch").bsSuggest({
            //     indexId: 2, //data.value 的第几个数据，作为input输入框的内容
            //     indexKey: 1, //data.value 的第几个数据，作为input输入框的内容
            //     //TODO 通过json显示数据
            //     data: {
            //         'value': [
            //             {
            //                 'id': "",
            //                 'word': 'Java',
            //             },
            //             {
            //                 'id': "",
            //                 'word': 'C++',
            //             },
            //         ]
            //     }
            // });

            // var testdataBsSuggest3 = $(".major").bsSuggest({
            //     indexId: 2, //data.value 的第几个数据，作为input输入框的内容
            //     indexKey: 1, //data.value 的第几个数据，作为input输入框的内容
            //     //TODO 通过json显示数据
            //     data: {
            //         'value': [
            //             {
            //                 'id': "",
            //                 'word': 'mysql',
            //             },
            //             {
            //                 'id': "",
            //                 'word': 'orcal',
            //             },
            //         ]
            //     }
            // });
//=======================================================主表格======================================================================
            //var initdata = function () {
            //var init = new Object();
            //init.Init = function () {
            //加载之前先格式化 放在查询的时候起冲突
            $("#tb_major").bootstrapTable('destroy')
            $("#tb_major").bootstrapTable({
                url: '/owep/evaluation/allTeacherPollItem',
                method: 'get',
                striped: true,  //是否显示行间隔色
                cache: false, //是否使用缓存
                pagination: true, //是否分页
                pageSize: 5,  //每页记录行数
                uniqueId: 'id',  //唯一id
                pageList: [5, 10, 20],
                //queryParams: queryParams, // 传递参数
                columns: [{
                    field: "coo",
                    checkbox: true,
                }, {
                    field: 'id',
                    title: '序号'
                }, {
                    field: 'teacherName',
                    title: '老师名称'
                }, {
                    field: 'className',
                    title: '班级'
                }, {
                    field: 'pollAddress',
                    title: '考评地址'
                }, {
                    field: 'pollGrade',
                    title: '考评成绩'
                }, {
                    field: 'pollCount',
                    title: '考评人数',
                    visible: false
                }, {
                    field: 'pollSuggest',
                    title: '考评建议',
                    visible: false
                }, {
                    field: 'startTime',
                    title: '开始时间',
                    visible: false
                }, {
                    field: 'endTime',
                    title: '结束时间',
                    visible: false
                }, {
                    field: 'effectiveTime',
                    title: '有效期'
                }, {
                    field: 'pollStatus',
                    title: '状态',
                    formatter: teacherPollStatus
                }, {
                    field: 'operator',
                    title: "操作",
                    align: "center",
                    valign: "middle",
                    width: "15%",
                    formatter: actionFormatter, //方法调用
                    events: {
                        'click button[title=删除]': function (e, value, row, index) {//动态嵌入按键：删除
                            deleteRecord(e, value, row, index, "/owep/evaluation/deleteTeacherPollId", '#tb_major');
                        },
                        'click button[title=查看详情]': function (e, value, row, index) {
                            $("#detailModal").modal();
                            //回显数据
                            $('#d-teacher_name').html(row.teacherName);
                            $('#d-clazz_name').html(row.className);
                            $('#d-poll_name').html(row.pollCount);
                        },
                        'click button[title=修改]': function (e, value, row, index) {
                            $("#updateModal").modal();
                            //回显数据


                            $("#class_update").val(row.className);
                            $("#update_teacherName").val(row.teacherName);
                            $("#update_startDate").val(row.startTime);
                            $("#update_endDate").val(row.endTime);



                        },
                        'click button[title=审核]': function (e, value, row, index){
                            $("#checkModal").modal();
                            $("#check_teacherName").val(row.teacherName);

                        }
                    }
                }]
            });

            //};
            function teacherPollStatus(value) {
                if (value == 1) {
                    return "未开始"
                }
                if (value == 2) {
                    return "进行中"
                }
                if (value == 3) {
                    return "已结束"
                }
                if (value == 4) {
                    return "已审核"
                }
            }

            queryParams = function (params) {
                console.log(params);
                console.log($('#name').val());
                return {
                    offset: params.offset,//从数据库第几条记录开始
                    limit: params.limit,//找多少条
                    org: $("#org").val(),
                    branch: $("#branch").val(),
                    major: $("#major").val()
                };
            }

            //操作栏的格式化
            function actionFormatter(value, row, index) {
                var id = value;
                var result = "";
                return '<button id="+id+" type="button" class="btn btn-white btn-sm" title="审核"><i class="glyphicon glyphicon-check text-success"/></button>' +
                    '<button id="+id+" type="button" class="btn btn-white btn-sm" title="查看详情"><i class="glyphicon glyphicon-exclamation-sign text-info"/></button>' +
                    '<button id = "+id+" type = "button" class = "btn btn-white btn-sm" title="修改" > <i class="glyphicon glyphicon-edit"/> </button>' +
                    '<button id = "+id+" type = "button" class = "btn btn-white btn-sm" title="删除"> <i class="glyphicon glyphicon-trash text-danger"/> </button>';
            };

            //return init;
        });
</script>

<script>
    /*模态框中的bootstraptable初始化*/
    $(function () {
        $(".option").bootstrapTable({
            url: '../../static/js/demo/evaluation/option.json',
            toolbar: '#toolbar', // 工具按钮用哪个容器
            method: 'get',
            pagination: true,
            cache: false,
            sortable: true, //是否启用排序
            sortOrder: "asc", // 排序方式
            sidePagination: "client", // 分页方式：client客户端分页，server服务端分页（*）
            pageNumber: 1,
            pageSize: 10,
            pageList: [10, 25, 50, 100],
            uniqueId: "ID",
            columns: [{
                field: 'options',
                title: '考评选项'
            }, {
                field: 'score',
                title: '平均分'
            }]
        });

        $(".suggest").bootstrapTable({
            // url: '../../static/js/demo/evaluation/suggest.json',
            toolbar: '#toolbar', // 工具按钮用哪个容器
            method: 'get',
            pagination: true,
            cache: false,
            sortable: true, //是否启用排序
            sortOrder: "asc", // 排序方式
            sidePagination: "client", // 分页方式：client客户端分页，server服务端分页（*）
            pageNumber: 1,
            pageSize: 10,
            pageList: [10, 25, 50, 100],
            uniqueId: "ID",
            data: [{
                "id": 1,
                "suggest": "少吃零食多睡觉"
            }, {
                "id": 2,
                "suggest": "少吃零食多睡觉"
            }, {
                "id": 3,
                "suggest": "少吃零食多睡觉"
            }, {
                "id": 4,
                "suggest": "少吃零食多睡觉"
            }, {
                "id": 5,
                "suggest": "少吃零食多睡觉"
            }],
            columns: [{
                field: 'id',
                title: '序号'
            }, {
                field: 'suggest',
                title: '考评建议'
            }]
        });
    })
</script>

<!--  改变表单允许IP输入域的状态 -->
<script>
    $(function () {
        $('input[type=radio][name=optionsRadios]').change(function () {
            console.log(this.value);
            if (this.value == 'option1') {
                $(".changeID").attr("disabled", false);
                // alert("选项1")
            } else if (this.value = 'option2') {
                // alert("选项2")
                $(".changeID").attr("disabled", true);
            }
        })
    })
</script>

</body>
</html>